staircase hackerrank solution